#include<iostream>

using namespace std;

typedef struct{
    int x;
    int y;
    char type;
}Point;

typedef struct{
    bool val;
    char type;
}Flag;


Point point[1000];
int n, m;
Flag flag;
int tmp;

int main(){
    cin >> n >> m;
    for(int i = 0; i < n; i ++){
        cin >> point[i].x >> point[i].y >> point[i].type;
    }
    for(int k = 0; k < m; k ++){
        int a, b, c;
        cin >> c >> a >> b;
        tmp = 0;
        for(int i = 0; i < n; i ++){
            int x = a * point[i].x + b * point[i].y + c;
            if(i == 0){
                if(x > 0) flag.val = true;
                else flag.val = false;
                flag.type = point[i].type;
                continue;
            }
            if(flag.type == point[i].type){
                if((x > 0) != flag.val){
                    cout << "No" << endl;
                    tmp = 1;
                    break;
                }
            }
            else{
                if((x > 0) == flag.val){
                    cout << "No" << endl;
                    tmp = 1;
                    break;
                }
            }
        }
        if(tmp == 0){
            cout << "Yes" << endl;
        }
    }
    return 0;
}